package com.ry.novel.model.resp;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @author ry
 * @since 2022-01-22 20:03
 **/
public enum ResultCode implements IResultCode{
    OK(200,"SUCCESS"),
    PARAM_ERROR(400,"参数错误"),
    FORBIDDEN(403,"没有权限"),
    ERROR(500,"未知异常");


    /**
     * 状态码
     */
    private Integer code;

    /**
     * 消息
     */
    private String msg;

    ResultCode() {
    }

    ResultCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
